package com.sjf.batch.controller;

import com.alibaba.fastjson.JSONObject;
import com.sjf.batch.demo.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author <huangtang>
 * @since 2022/1/20 9:23
 **/
@Api(value = "Json测试")
@RestController
@RequestMapping("/")
public class JsonController {

    @ApiOperation(value = "Json数据的展示")
    @PostMapping(value = "show")
    public String show (
            @ApiParam(value = "用户参数")
            @RequestBody User user ) {
        String jsonString = JSONObject.toJSONString (user);
        return jsonString;
    }

}
